#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QTcpServer>
#include <QTcpSocket>
#include <QMessageBox>
#include "msg.h"
#include "loginframe.h"
#include "chat.h"

namespace Ui {
class MainWindow;
}


class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();
    void LogonFrame();
    int isLogonFlag = false;


private:
    Ui::MainWindow *ui;
    QTcpSocket * socket = NULL;
    Chat * chat = NULL;
    LoginFrame* loginframe = NULL;
    int _isLogonFlag = 0;
    QString username;


private slots:
    //void LoginFunction();
    //void DealLoginAnswer();
    void LoginFunction();
    void LogonFunction();
    void DealAnswer();
};

#endif // MAINWINDOW_H
